package calc.buttonPanel;

import javax.swing.JPanel;

public class OperatorPanel extends JPanel{

	
	private CalcButton jiaButton; // +
	private CalcButton jianButton; // -
	private CalcButton chengButton;// ×
	private CalcButton chuButton; // ÷
	
	private CalcButton fanButton; // ±
	private CalcButton genButton; // √
	private CalcButton daoButton; // 1/x
	private CalcButton baiButton; // %
	
	private CalcButton dengButton; // =
	
	
	public OperatorPanel() {
		
		// 建立按钮对象
		jiaButton = new CalcButton("+");
		jianButton = new CalcButton("-");
		chengButton = new CalcButton("×");
		chuButton = new CalcButton("÷");
		
		fanButton = new CalcButton("±");
		genButton = new CalcButton("√");
		daoButton = new CalcButton("1/x");
		baiButton = new CalcButton("%");
		
		dengButton = new CalcButton("=");
		dengButton.setSize(50, 105);
		
		
		// 设置个按钮位置
		fanButton.setLocation(0, 0);
		genButton.setLocation(55, 0);
		
		jiaButton.setLocation(0, 55);
		jianButton.setLocation(0, 110);
		chengButton.setLocation(0, 165);
		chuButton.setLocation(0, 220);
		
		baiButton.setLocation(55, 55);
		daoButton.setLocation(55, 110);
		dengButton.setLocation(55, 165);
		

		// 将按钮加入Panel中
		setLayout(null);
		add(fanButton);
		add(genButton);
		add(jiaButton);
		add(baiButton);
		add(jianButton);
		add(daoButton);
		add(chengButton);
		add(chuButton);
		add(dengButton);
		
	}


	public CalcButton getJiaButton() {
		return jiaButton;
	}


	public void setJiaButton(CalcButton jiaButton) {
		this.jiaButton = jiaButton;
	}


	public CalcButton getJianButton() {
		return jianButton;
	}


	public void setJianButton(CalcButton jianButton) {
		this.jianButton = jianButton;
	}


	public CalcButton getChengButton() {
		return chengButton;
	}


	public void setChengButton(CalcButton chengButton) {
		this.chengButton = chengButton;
	}


	public CalcButton getChuButton() {
		return chuButton;
	}


	public void setChuButton(CalcButton chuButton) {
		this.chuButton = chuButton;
	}


	public CalcButton getFanButton() {
		return fanButton;
	}


	public void setFanButton(CalcButton fanButton) {
		this.fanButton = fanButton;
	}


	public CalcButton getGenButton() {
		return genButton;
	}


	public void setGenButton(CalcButton genButton) {
		this.genButton = genButton;
	}


	public CalcButton getDaoButton() {
		return daoButton;
	}


	public void setDaoButton(CalcButton daoButton) {
		this.daoButton = daoButton;
	}


	public CalcButton getBaiButton() {
		return baiButton;
	}


	public void setBaiButton(CalcButton baiButton) {
		this.baiButton = baiButton;
	}


	public CalcButton getDengButton() {
		return dengButton;
	}


	public void setDengButton(CalcButton dengButton) {
		this.dengButton = dengButton;
	}
	
}
